package com.cssl.springbootdemo01.controller;

import com.cssl.springbootdemo01.pojo.Users;
import com.cssl.springbootdemo01.service.UsersService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class UsersController {
    @Resource
    private UsersService uservice;

    public UsersController(UsersService uservice) {
        System.out.println("UsersController");
    }

    @ResponseBody
    @GetMapping("query")
    public List<Users> select(){
        System.out.println("query");
        return uservice.select();
    }
}
